import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

import "./style.css";
import "swiper/scss";
import "swiper/scss/navigation";
import "swiper/scss/pagination";

import App from "./App.vue";
import router from "./router";

// 1. 引入你需要的组件
import { Button } from "vant";
import { Popup } from 'vant';
// 2. 引入组件样式
import "vant/lib/index.css";

const app = createApp(App);
app.use(ElementPlus);
app.use(router);
app.mount("#app");
app.use(Button);
app.use(Popup);

app.config.warnHandler = () => null;

import Sortable from "sortablejs";
app.directive("sortable", {
  mounted(el, binding) {
    new Sortable(el, {
      animation: 150,
      ...binding.value, // 允许传递配置对象
    });
  },
});
